SpatialStream® Code Examples

Census Thematic Mapping

Using the Census Boundaries, GetMap, SLD, and Legend SpatialStream® components, you can create dynamic trend maps for your mapping application with your own data or data available through the SpatialStream® Content Library. This example will demonstrate how create a custom census area thematic map, use GetMap to display the map overlay and generate a legend image with Legend. The thematic map will display the median value of demographic owner households, by census block group for Los Angeles County, California.

Creating thematic maps using SpatialStream&trade has several advantages including performance, ease, and interactivity. SpatialStream® generated thematic maps relieve developers from the task of linking tabular data to spatial data (home sales to postal code boundaries here) and make it easy to define new map styles and trend views with only a new SLD.

Census Boundaries | GetMap | Legend | SLD

var CensusBlkGroup = new Dmp.Layer.WMSLayer("census", "SS", {
antiAlias: true
});
CensusBlkGroup.addChild("CensusBlkGroup", "DMP_LICENSE/CensusBlockGroup_TA_DB", "$(ACCOUNT_FOLDER)SLD/Demographicthematic.xml", {
attributeLinks: 'DEMOGRAPHICLINK', zoomRange: {
min: 10, max: 19
}
});
map.addLayer(CensusBlkGroup);

//----------------

var baseUrl = Dmp.Env.Connections["SS"].getBaseUrl();
var imgObj = document.getElementById("legend");
imgObj.src = baseUrl + "legend.aspx?&layer=DMP_LICENSE/DEMOGRAPHIC_DATA_OC&SLD=$(ACCOUNT_FOLDER)SLD/Demographicthematic.xml&headers=0";


Run Sample   View Video   Back To Index